<script lang="ts" setup>
import {RouterLink, useRouter} from 'vue-router'

const router = useRouter()

function goBack() {
  router.back()
}
</script>

<template>
  <div class="not-found">
    <div class="container">
      <div class="error-code">404</div>
      <div class="error-message">页面不存在</div>
      <div class="error-description">
        抱歉，您访问的页面不存在或已被删除
      </div>
      <div class="actions">
        <RouterLink class="home-btn" to="/">回到首页</RouterLink>
        <button class="back-btn" @click="goBack">返回上页</button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.not-found {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f5f6f9;
}

.container {
  text-align: center;
  padding: 40px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 20px;
  line-height: 1;
}

.error-message {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

.error-description {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 32px;
}

.actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.home-btn, .back-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.home-btn {
  background: #2563eb;
  color: white;
  border: none;
}

.home-btn:hover {
  background: #1d4ed8;
}

.back-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.back-btn:hover {
  background: #e5e7eb;
}
</style>